package com.snail.tools;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

/**
 * @Author 【swg】.
 * @Date 2017/12/22 10:08
 * @DESC
 * @CONTACT 317758022@qq.com
 */
public class WriteTo {
    // 设置文件存放的位置
    private static File f = new File("D:\\三星手机.txt");
    public static void writeto(String content) throws IOException {
        //使用续写的方式，以免覆盖前面写入的内容
        BufferedWriter bw = new BufferedWriter(new FileWriter(f, true));
        bw.append(content);
        bw.flush();
        bw.close();
    }
}
